function fibonacci(n) {
  // 递归终止条件
  if (n <= 2) {
    return 1
  }
  // 相同重复逻辑，缩小问题的规模
  return fibonacci(n - 1) + fibonacci(n - 2)
}

function fibonacci(n) {
  if (n <= 2) return 1
  let first = 1
  let second = 1
  let ret = 0
  n -= 2

  while (n--) {
    ret = first + second
    first = second
    second = ret
  }
  return ret
}